/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'

export const systemRoute = {
  path: '/system',
  component: Layout,
  alwaysShow: true, // will always show the root menu
  name: 'system',
  meta: {
    title: '系统管理',
    icon: 'el-icon-setting'
  },
  children: [
    {
      path: 'org',
      component: () => import('@/views/system/org'),
      name: 'system-rog',
      redirect: '/system/org',
      alwaysShow: true,
      meta: {
        roles: ['system:org', 'system:user', 'system:department', 'system:position'],
        icon: 'el-icon-menu',
        title: '组织管理'
      },
      children: [
        {
          path: 'department',
          component: () => import('@/views/system/org/department/index.vue'),
          name: 'system-rog-department',
          meta: {
            roles: ['system:department'],
            title: '部门管理'
          }
        },
        {
          path: 'position',
          component: () => import('@/views/system/org/position/index.vue'),
          name: 'system-rog-position',
          meta: {
            roles: ['system:position'],
            title: '岗位管理'
          }
        },
        {
          path: 'user',
          component: () => import('@/views/system/org/user/index.vue'),
          name: 'system-rog-user',
          meta: {
            roles: ['system:user'],
            title: '用户管理'
          }
        }
      ]
    },
    {
      path: 'authority',
      component: () => import('@/views/system/authority'),
      name: 'system-authority',
      alwaysShow: true,
      meta: {
        roles: ['system:authority', 'system:role', 'system:permission'],
        icon: 'el-icon-s-claim',
        title: '权限管理'
      },
      children: [
        {
          path: 'role',
          component: () => import('@/views/system/authority/role/index.vue'),
          name: 'system-authority-role',
          meta: {
            roles: ['system:role'],
            title: '角色管理'
            // if do not set roles, means: this page does not require permission
          }
        },
        {
          path: 'permission',
          component: () => import('@/views/system/authority/permission/index.vue'),
          name: 'system-authority-permission',
          meta: {
            roles: ['system:permission'],
            title: '菜单权限'
          }
        }
      ]
    },
    {
      path: 'config',
      component: () => import('@/views/system/config'),
      name: 'system-config',
      meta: {
        roles: ['system:config:manage', 'system:config', 'system:config:category'],
        icon: 'el-icon-set-up',
        title: '配置项管理'
      },
      children: [
        {
          path: 'category',
          component: () => import('@/views/system/config/category/index.vue'),
          name: 'system-config-category',
          meta: {
            roles: ['system:config:category'],
            title: '分类管理'
          }
        },
        {
          path: 'index',
          component: () => import('@/views/system/config/index/index.vue'),
          name: 'system-config-index',
          meta: {
            roles: ['system:config'],
            title: '配置列表'
          }
        }
      ]
    },
    {
      path: 'crontab',
      component: () => import('@/views/system/crontab'),
      name: 'system-crontab',
      alwaysShow: true,
      meta: {
        roles: ['system:crontab:manage', 'system:crontab', 'system:crontab:category'],
        icon: 'el-icon-stopwatch',
        title: '定时任务'
      },
      children: [
        {
          path: 'category',
          component: () => import('@/views/system/crontab/category/index.vue'),
          name: 'system-crontab-category',
          meta: {
            roles: ['system:crontab:category'],
            title: '分类管理'
          }
        },
        {
          path: 'index',
          component: () => import('@/views/system/crontab/index/index.vue'),
          name: 'system-crontab-index',
          meta: {
            roles: ['system:crontab'],
            title: '任务列表'
          }
        }
      ]
    },
    {
      path: 'log',
      component: () => import('@/views/system/log'),
      name: 'system-log',
      alwaysShow: true,
      meta: {
        roles: ['system:log', 'system:log:http', 'system:log:server'],
        icon: 'el-icon-bangzhu',
        title: '日志管理'
      },
      children: [
        {
          path: 'http',
          component: () => import('@/views/system/log/http/index.vue'),
          name: 'system-log-http',
          meta: {
            roles: ['system:log:http'],
            title: '路由日志'
          }
        },
        {
          path: 'server',
          component: () => import('@/views/system/log/server/index.vue'),
          name: 'system-log-server',
          meta: {
            roles: ['system:log:server'],
            title: '服务日志'
          }
        }
      ]
    },
    {
      path: 'monitor',
      component: () => import('@/views/system/monitor'),
      name: 'system-monitor',
      alwaysShow: true,
      meta: {
        roles: ['system:monitor:server', 'system:monitor:onlineUser'],
        icon: 'el-icon-discover',
        title: '系统监控'
      },
      children: [
        {
          path: 'http',
          component: () => import('@/views/system/monitor/server/index.vue'),
          name: 'system-monitor-server',
          meta: {
            roles: ['system:monitor:server'],
            title: '服务监控'
          }
        },
        {
          path: 'server',
          component: () => import('@/views/system/monitor/online-user/index.vue'),
          name: 'system-monitor-onlineUser',
          meta: {
            roles: ['system:monitor:onlineUser'],
            title: '在线用户'
          }
        }
      ]
    }
  ]
}
